projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6c2532
)
(Fstring_to_char): Don't return a multibyte character
author
Kenichi Handa
<handa@m17n.org>
Fri, 6 Nov 1998 00:44:16 +0000
(
00:44
+0000)
committer
Kenichi Handa
<handa@m17n.org>
Fri, 6 Nov 1998 00:44:16 +0000
(
00:44
+0000)
if STRING is a unibyte string.
src/editfns.c
patch
|
blob
|
history
diff --git
a/src/editfns.c
b/src/editfns.c
index bf3eebb5247303048026500c20410c8ca3dc43a0..495ffb4a56a2ef2a244dff9a8ae2153b367f30c4 100644
(file)
--- a/
src/editfns.c
+++ b/
src/editfns.c
@@
-154,7
+154,12
@@
A multibyte character is handled correctly.")
CHECK_STRING (string, 0);
p = XSTRING (string);
if (p->size)
- XSETFASTINT (val, STRING_CHAR (p->data, STRING_BYTES (p)));
+ {
+ if (STRING_MULTIBYTE (string))
+ XSETFASTINT (val, STRING_CHAR (p->data, STRING_BYTES (p)));
+ else
+ XSETFASTINT (val, p->data[0]);
+ }
else
XSETFASTINT (val, 0);
return val;